import bb.cascades 1.0
import bb.multimedia 1.0

NavigationPane {
    id: navigationPane
    backButtonsVisible: false
    // The initial page
    Page {
        content: Container {
            id: root
            layout: AbsoluteLayout {
            }
            onCreationCompleted: {
                myPlayer.setSourceUrl("asset:///sounds/s.mp3");
                myPlayer.play(); 
            }
            ImageView {
                horizontalAlignment: HorizontalAlignment.Fill
                verticalAlignment: VerticalAlignment.Fill
                imageSource: "asset:///images/bgMenu.png"
            }
            //        Button {
            //            imageSource: "asset:///images/btnPlay.png"
            //        }
            ImageButton {
                defaultImageSource: "asset:///images/btnPlay.png"
                pressedImageSource: "asset:///images/btnPlay.png"
                disabledImageSource: "asset:///images/btnPlay.png"
                verticalAlignment: VerticalAlignment.Center
                horizontalAlignment: HorizontalAlignment.Center
                layoutProperties: AbsoluteLayoutProperties {
                    positionX: 350.0
                    positionY: 260.0
                }
                preferredWidth: 700.0
                preferredHeight: 300.0
                onClicked: {
                    navigationPane.push(firstPage);
                    _app.loadListMusic("0")
                }
            }
            ImageView {
                imageSource: "asset:///images/TapMe.png"
                layoutProperties: AbsoluteLayoutProperties {
                    positionX: 90.0
                    positionY: 90.0
                }
            }
            ImageButton {
                defaultImageSource: "asset:///images/btnAbout.png"
                pressedImageSource: "asset:///images/btnAbout.png"
                disabledImageSource: "asset:///images/btnAbout.png"
                horizontalAlignment: HorizontalAlignment.Center
                layoutProperties: AbsoluteLayoutProperties {
                    positionX: 600.0
                    positionY: 620.0
                }
                preferredHeight: 100.0
                preferredWidth: 400.0
                onClicked: {
                    navigationPane.push(aboutPage);
                }
            }
            ImageButton {
                defaultImageSource: "asset:///images/btnQuit.png"
                pressedImageSource: "asset:///images/btnQuit.png"
                disabledImageSource: "asset:///images/btnQuit.png"
                layoutProperties: AbsoluteLayoutProperties {
                    positionX: 80.0
                    positionY: 620.0
                }
                preferredWidth: 400.0
                preferredHeight: 100.0
                onClicked: {
                    Application.quit();
                }
            }
        }
    } // end of Page
    attachedObjects: [
        MusicList {
            id: firstPage
        },
        AboutScreen {
            id: aboutPage
        },
        MenuScreen {
            id: menuPage
        },
        MainGame {
            id: maingamePage
        },
        MediaPlayer {
                    id: myPlayer
                }
    ] // end of attachedObjects list
}// end of NavigationPan
